#include <iostream>
#include <string>
using namespace std;
using LL = long long;
const int N = 200010;
int l, r, n;
string s;

LL find(int x)
{
    LL ret = 0;
    int l = 0, r = 0;
    int hsh[500] = { 0 };
    int num = 0;
    while(r < n)
    {
        char ch = s[r];
        if(hsh[ch]++ == 0) num++;
        while(num > x)
        {
            if(--hsh[s[l]] == 0) num--;
            ++l;
        } 
        ret += r - l + 1;
        ++r;
    }
    return ret;
}



int main()
{
    cin >> n >> l >> r;
    cin >> s;
    cout << find(r) - find(l - 1) << endl;
    return 0;
}
